import { stringify } from 'qs';
import request from '@/utils/request';

//一、物流跟踪平台
export async function queryLogisticsRule(params) {
  return request(`/api/queryLogistics?${stringify(params)}`);
}
export async function queryLogisticsByCode(params) {
  return request(
    '/server/api/track-order/insideSelectOrderInfo',
    {
      method: 'POST',
      body: {
        appKey: 'systemId',
        appSecret: 'DSKN235SD1DE3Y78C',
        messageId: 'MSG18772016',
        orderNos: params.orderNo,
        visitType: 'inside',
      },
    },
    true
  );
}
//二、轨迹更新
// 1、轨迹更新列表
export async function trailUpdateList(params) {
  const { ...body } = params;
  return request(`/server/api/track-order/selectTrackByOrderNo`, {
    method: 'POST',
    body,
  });
}
// 2、编辑、新增轨迹更新节点
export async function opreateTrack(params) {
  const { ...body } = params;
  return request(`/server/api/track-order/changeTrack`, {
    method: 'POST',
    body: params,
  });
}
//节点状态
export async function selectEvents(params) {
  const { ...body } = params;
  return request(`/server/api/track-order/selectEvents`, {
    method: 'POST',
    body: params,
  });
}

/**
 * 查询附件
 */
export async function selectFileList(params) {
  return request(`/server/api/tms/attachment/selectFileList`, {
    method: 'POST',
    body: params,
  });
}
